/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/5/6 13:52
 * @Copyright 博为峰
 */
public class SwitchDemo {
    public static void main(String[] args) {
        /*
           switch(表达式) { //int short byte char string 枚举
             case 值1:
               语句;
               break;
             case 值2:
               语句;
               break;
             ...
             default:
               语句;
           }
        */
        //根据用户输入，输出1月-12月对应的天数
        int month = 15;

        switch (month) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                System.out.println("31天");
                break;
            case 2:
                System.out.println("29天");
            case 4:
            case 6:
            case 9:
            case 11:
                System.out.println("30天");
                break;
            default:
                System.out.println("无对应的月份");
        }

        /*if (month == 1) {
            System.out.println("31天");
        } else if (month == 2) {
            System.out.println("29天");
        } else if (month == 3) {
            System.out.println("31天");
        }*/

        /*if (month == 1) {
            System.out.println("31天");
        }

        if (month == 2) {
            System.out.println("29天");
        }

        if (month == 3) {
            System.out.println("31天");
        }*/


    }
}
